<section id="content-title">
	<#if activeForm?? && activeForm == "addForm">
	<h1 style="display:none;"><@spring.message "itemAddPage.content.title" /></h1>
	<img src="<@spring.url '/resources/images/ajouter-une-annonce.jpg' />" alt="<@spring.message "itemAddPage.content.title" />" />
	<#else>
	<h1><@spring.message "itemUpdatePage.content.title" /></h1>
	</#if>
</section>
<section id="main-content">
	<div id="add-item">
		<@spring.bind "article" />
		<@spring.bind "regions" />
		<@spring.bind "types" />
		<#if activeForm?? && activeForm == "addForm">
		<form id="add-edit-form" action="<@spring.url '/add' />" name="article" method="post">
		<#else>
		<form id="add-edit-form" action="<@spring.url '/edit' />" name="article" method="post">
			<@spring.formHiddenInput "article.id" />
		</#if>
			<div id="add-item-block-1" class="info-block">
				<h2><@spring.message "itemAddPage.item.1.title" /></h2>
				<div id="regionControlGroup">
					<label for="region"><@spring.message "itemAddPage.item.1.region" /></label>
					<@spring.formSingleSelect "article.region", regions />
					<div class="help-inline"><@spring.showErrors ' '/></div>
				</div>
				<div id="postalCodeControlGroup">
					<label for="postalCode"><@spring.message "itemAddPage.item.1.codepostal" /></label>
					<@spring.formInput "article.postalCode" />
					<div class="help-inline"><@spring.showErrors ' '/></div>
				</div>
			</div>

			<div id="add-item-block-2" class="info-block">
				<h2><@spring.message "itemAddPage.item.2.title" /></h2>
				<div id="categoryControlGroup">
					<label for="category"><@spring.message "itemAddPage.item.2.category" /></label>
					<@spring.formSingleSelect "article.category", categories />
					<div class="help-inline"><@spring.showErrors ' '/></div>
				</div>
				<div id="typeControlGroup">
					<label for="type"><@spring.message "itemAddPage.item.2.type" /></label>
					<#list types as type>
					<input id="type${type_index}" type="radio" name="type" <#if (activeForm == "addForm" && type_index == 0) || (activeForm == "editForm" && type_index + 1 == article.type?number)>checked</#if> value="${type.name}" />
					${type.value}
					</#list>
					<div class="help-inline"><@spring.showErrors ' '/></div>
				</div>
			</div>

			<div id="add-item-block-3" class="info-block">
				<h2><@spring.message "itemAddPage.item.3.title" /></h2>
				<div id="nameControlGroup">
					<label for="name"><@spring.message "itemAddPage.item.3.name" /></label>
					<@spring.formInput "article.name" />
					<div class="help-inline"><@spring.showErrors ' '/></div>
				</div>
				<div id="emailControlGroup">
					<label for="email"><@spring.message "itemAddPage.item.3.email" /></label>
					<@spring.formInput "article.email" />
					<div class="help-inline"><@spring.showErrors ' '/></div>
				</div>
				<div id="phoneControlGroup">
					<label for="phone"><@spring.message "itemAddPage.item.3.phone" /></label>
					<@spring.formInput "article.phone" />
					<div class="help-inline"><@spring.showErrors ' '/></div>
				</div>
			</div>

			<div id="add-item-block-4" class="info-block">
				<h2><@spring.message "itemAddPage.item.4.title" /></h2>
				<div id="titleControlGroup">
					<label for="title"><@spring.message "itemAddPage.item.4.item.title" /></label>
					<@spring.formInput "article.title" />
					<div class="help-inline"><@spring.showErrors ' '/></div>
				</div>
				<div id="descriptionControlGroup">
					<label for="description"><@spring.message "itemAddPage.item.4.item.desc" /></label>
					<@spring.formTextarea "article.description", "rows='4' cols='50'" />
					<div class="help-inline"><@spring.showErrors ' '/></div>
				</div>
				<div id="priceControlGroup">
					<label for="price"><@spring.message "itemAddPage.item.4.item.price" /></label>
					<@spring.formInput "article.price", "size='10'" />
					<div class="help-inline"><@spring.showErrors ' '/></div>
				</div>
			</div>

			<div id="add-item-block-5" class="info-block">
				<h2><@spring.message "itemAddPage.item.5.title" /></h2>
				<img src="<@spring.url '/images/${article.pictureUrl!"no-photo.jpg"}' />" />
				<button><@spring.message "itemAddPage.item.5.add" /></button>
			</div>

			<div id="add-item-submit">
				<input type="submit" value="" />
			</div>
		</form>
	</div>
</section>